<?
/*
 * Copyright 2004-2005 Sigve Indregard.
 *
 * This file is part of Laivsys.
 *
 * Laivsys is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * Laivsys is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Laivsys; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

/*
 * $Id: alleroller.php 6 2005-07-11 23:14:47Z say $
 */
 
include_once("db.php");
include_once("laivid.php");
include_once("design.php");
include("admin/rollerinclude.php");

$arr=getLaiv();

$sidetittel=$arr['Tittel']." - Rollebeskrivelser";
include("top.php");


if (time() > strtotime($arr['Roller_release'])) {
	if ($_REQUEST['id'] != "") {
		headline("Rollebeskrivelser");
		echo "<div class=\"text\">\n";
		echo "<p><a href=\"alleroller.php\">Tilbake til oversikten</a></p>";
		completeRollebeskrivelse($_REQUEST['id'], "alleroller.php?id=");
	} else {
		headline("Rollebeskrivelser");
		text(listRoller($arr['ID']));
	}
} else {
	headline("Rollebeskrivelser");
	text("Disse blir ikke tilgjengelig f�r ".isodateformat($arr['Roller_release']).".");
}


include ("bottom.php");

function listRoller($laiv) {
	$sql="SELECT * FROM r_Rolle WHERE LaivID=$laiv ORDER BY familienavn, rollenavn";
	$roller=mysql_query($sql) or die(mysql_error());
	$retur="";
	while ($rolle = mysql_fetch_assoc($roller)) {
		$retur.= "<a href=\"alleroller.php?id={$rolle['ID']}\">";
		$retur.= "&gt;&gt;&gt;</a>&nbsp;";
		$retur.= getRollenavn($rolle['rollekode'])."<br/>";
	}
	return $retur;
}
?>
